package lol.clann.minecraft.springboot.plugin.module.devtools.commands;

import lol.clann.minecraft.springboot.api.annotation.command.Command;
import lol.clann.minecraft.springboot.api.annotation.command.CommandDefine;
import lol.clann.minecraft.springboot.api.annotation.command.Sender;
import lol.clann.minecraft.springboot.api.annotation.condition.ConditionalOnMinecraftVersion;
import lol.clann.minecraft.springboot.api.annotation.condition.MinecraftVersionRange;
import lol.clann.minecraft.springboot.plugin.module.devtools.ListItemUtils;
import lombok.extern.slf4j.Slf4j;
import org.bukkit.Particle;
import org.bukkit.command.CommandSender;

import java.util.Arrays;
import java.util.Objects;

/**
 *
 * @author pyz
 * @date 2019/5/20 10:40 PM
 */
@ConditionalOnMinecraftVersion(@MinecraftVersionRange(min = 10900))
@CommandDefine(name = "devtools")
public class ListParticleCommand {

    @Command(showArgs = "listParticle", des = "列出所有Particle")
    private boolean listParticle(@Sender CommandSender sender) {
        ListItemUtils.listInSingleLine(sender,
                "%s",
                Arrays.stream(Particle.values())
                        .filter(Objects::nonNull)
                        .map(i -> i.name()));
        return true;
    }

}
